//
//  FinancialInterest.m
//  MINFOBBS
//
//  Created by juvid on 13-11-29.
//  Copyright (c) 2013年 minfo. All rights reserved.
//

#import "FinancialInterest.h"
#import "UIColor+expanded.h"
@interface FinancialInterest ()

@end

@implementation FinancialInterest

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
//    NSLog(@"%@",self.arrReturn);
//    [self.tableView reloadData];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
 
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
//#warning Potentially incomplete method implementation.
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
//#warning Incomplete method implementation.
    // Return the number of rows in the section.
    return self.arrReturn.count+1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    cell.textLabel.backgroundColor=[UIColor clearColor];
    if (indexPath.row%2==1) {
        UIView *vie=[[UIView alloc]init];
        vie.backgroundColor=[UIColor colorWithHexString:@"0xf3f3f3"];
        cell.backgroundView=vie;
    }
    else{
        cell.backgroundColor=[UIColor whiteColor];
    }
    UILabel *lab=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 60, 44)];
    
    lab.textColor=[UIColor colorWithHexString:@"0x565656"];
    lab.backgroundColor=[UIColor clearColor];
    lab.font=[UIFont systemFontOfSize:14];
    cell.accessoryView=lab;
    cell.textLabel.font=[UIFont systemFontOfSize:14];
    cell.indentationLevel = 1;
    cell.indentationWidth = 20.0f;
    cell.textLabel.textColor=[UIColor colorWithHexString:@"0x565656"];
    if (indexPath.row==0) {
         cell.backgroundColor=[UIColor whiteColor];
        cell.textLabel.text=@"年限";
        lab.text=@"利率";
        cell.textLabel.font=[UIFont systemFontOfSize:15];
        lab.font=[UIFont systemFontOfSize:15];
    }
    else{
       cell.textLabel.text=[[self.arrReturn objectAtIndex:indexPath.row-1] objectForKey:@"name"];
        lab.text=[[self.arrReturn objectAtIndex:indexPath.row-1] objectForKey:@"text"];

    }
    cell.selectionStyle=UITableViewCellSelectionStyleNone;
    
   

    // Configure the cell...
    
    return cell;
}

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    }   
    else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Table view delegate

// In a xib-based application, navigation from a table can be handled in -tableView:didSelectRowAtIndexPath:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Navigation logic may go here, for example:
    // Create the next view controller.
    <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];

    // Pass the selected object to the new view controller.
    
    // Push the view controller.
    [self.navigationController pushViewController:detailViewController animated:YES];
}
 
 */

@end
